\subsection{Simulation}
\label{sub:Simulation}

\begin{figure}
\centerline{\includegraphics{./img/tb_everythingelse/with_arrows/tb_10-13_with_arrows.png}}
\caption{BlablablH}
\label{tb_10-13}
\end{figure}



\subsection{FPGA programming}

The FPGA was programmed by following the steps explained in the tutorial part of th compendium. The main.c file had to be modified by inserting an include statement and three defines.

\begin{lstlisting}
#include "mips_processor.h"
#define WR MIPS_PROCESSOR_mWriteReg
#define RR MIPS_PROCESSOR_mReadReg
#define BASE 0xC3C00000 
\end

The testbench that was used during simulation was then assembled into two txt files and used for testing the programmed FPGA together with the supplied python script host.py.
\lstinputlisting{dmem_in.txt}
\lstinputlisting{imem_in.txt}

\texttt{python host.py -p 8 -i imem_in.txt}
\texttt{python host.py -p 8 -d dmem_in.txt}
\texttt{python host.py -p 8 -c s}
\texttt{python host.py -p 8 -c s}
\texttt{python host.py -p 8 -r dmem_out.txt}

The result of the data memory after the execution of the program was then written to file.
\lstinputlisting{dmem_out.txt}
